import Vue from 'vue'
import VueRouter from 'vue-router'
import IndexView from "@/views/IndexView";
// import SearchView from "@/views/SearchView";
// import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        redirect: "/index"
    },
    {
        path: '/index',
        component: IndexView
    },
    {
        path: '/search',
        // component: SearchView
        component: () => import('@/views/SearchView')
    },
    {
        path: '/mine',
        component: ()=> import('@/views/MineView')
    },
    {
        path: '/detail',
        // component: SearchView
        component: () => import('@/views/MusivDetail')
    },
    {
        path: '/detail1',
        // component: SearchView
        component: () => import('@/views/SongDetail')
    },
    // {
    //   path: '/',
    //   name: 'home',
    //   component: HomeView
    // },
    {
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
    }
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router
